﻿@using NewRen.Models;
@using NewRen.Models.ViewModel;
@model NewRen.Models.ViewModel.vProduct
@{
    Business business = ViewBag.Bussiness;
    vProduct product = ViewBag.Product;
    ViewBag.Title = "商品管理-商品详情";
    Layout = "~/Views/Shared/_Layout_Business.cshtml";
}
<div class="ucenter-left account-left-border">
    <div class="ucneter-l-head cf">
        <div class="ulhead-headicon">
            @if (business.Picture == null)
            {
                <img src="/Images/userphoto.png" width="50" height="50"
                     alt=@business.BusinessName style="border-radius:50%;" />
            }
            else
            {
                <img src="/Business/ShowPicture/@business.ID" width="50"
                     alt=@business.BusinessName height="50" style="border-radius:50%;" />
            }


        </div>
        <div class="ulhead-info">
            <p class="ulhead-info-uname">@business.BusinessName</p>

            <div class="ulhead-info-tool">
                <a class="ulhead-icon icon-lock ucenter-mail " href="/Business/PwdEdit/@business.ID" title="修改密码">
                    <div class="ucenter-mail-tip">修改密码</div>
                </a>
                <a href="/User/Edit/@business.ID"
                   class="ulhead-icon icon-setting ucenter-mail" title="修改商户信息"></a>
            </div>
        </div>
    </div>
    <div class="ucenter-l-list">
        <ul class="ullist-ul">
            <li id="uclick">
                <a href="/Business/Show/@business.ID">商户中心</a>
            </li>
            <li id="uclick1">
                <a href="/Business/Edit/@business.ID">商户设置</a>
            </li>
            <li id="uclick2" class="active">
                <a href="/Business/ProductManager/@business.ID">商户商品</a>
            </li>
        </ul>
    </div>
</div>
<div class="ucenter-right cf">
    <div class="ucenter-right-head"></div>
    <div class="tabbed">
        <div class=" tabGroup">
            <div class="form-item">
                <div class="item-label">
                    <label>图片列表：<br>（请上传高像素图片）</label>
                </div>
                <div class="item-img-ls">
                    @if (ViewBag.ProductImg.Count > 0)
                    {
                        foreach (Images item in ViewBag.ProductImg)
                        {
                            <div class="col-md-3" id="img_@item.ID">
                                <img src="@item.Path" class="product_list_img">
                                <a href="javascript:deleteDialog('/Business/ProductPictureDelete/@item.ID?sid=@ViewBag.SID','img_@item.ID');" style="text-align:center;width:100px;display:inline-block;line-height:25px">删除</a>
                            </div>

                        }
                    }
                    else
                    {
                        <span class="defInfo">暂无图片</span>
                    }
</div>
            </div>
            @using (Html.BeginForm("AddProductPicture", "Business", FormMethod.Post, new { enctype = "multipart/form-data" }))
            {
                @Html.AntiForgeryToken()
                @Html.HiddenFor(model => model.ID, new { @value = product.ID })
                <div class="form-item">
                    <div class="item-label">
                        <label></label>
                    </div>
                    <div class="item-span">
                        <input id="fileupload" type="file" name="file" style="border:0">
                        <button class="btn">上传</button>
                    </div>
                </div>
            }
            <div class="form-item">
                <div class="item-label">
                    <label>产品名称：</label>
                </div>
                <div class="item-span">
                    <span class="defInfo">@product.ProductName</span>
                </div>
            </div>
            <div class="form-item">
                <div class="item-label">
                    <label>价格：</label>
                </div>
                <div class="item-span">
                    <span class="defInfo">@product.Price</span>
                </div>
            </div>
            <div class="form-item">
                <div class="item-label">
                    <label>兑换积分：</label>
                </div>
                <div class="item-span">
                    <span class="defInfo">@product.Integration</span>
                </div>
            </div>
            <div class="form-item">
                <div class="item-label">
                    <label>开始时间：</label>
                </div>
                <div class="item-span">
                    <span class="defInfo">@product.Begin</span>
                </div>
            </div>
            <div class="form-item">
                <div class="item-label">
                    <label>结束时间：</label>
                </div>
                <div class="item-span">
                    <span class="defInfo">@product.End</span>
                </div>
            </div>
            <div class="form-item">
                <div class="item-label">
                    <label>是否展示：</label>
                </div>
                <div class="item-span">
                    @if (product.IsShow)
                    {
                        <span class="defInfo">是</span>
                    }
                    else
                    {
                        <span class="defInfo">否</span>
                    }
                </div>
            </div>
            <div class="form-item">
                <div class="item-label">
                    <label>描述：</label>
                </div>
                <div class="item-span">
                    <span class="defInfo">@product.Description</span>
                </div>
            </div>
            <div class="form-item">
                <div class="item-label">
                    <label></label>
                </div>
                <div class="item-span">
                    <button class="btn" onclick="location.href='/Business/ProductEdit/@product.ID'">修改</button>
                </div>
            </div>
        </div>
    </div>
</div>